﻿using System;
using System.Windows;
using System.Windows.Controls;

namespace WpfApplication1
{
    public partial class Window1
    {
        public Window1()
        {
            InitializeComponent();
        }

        private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            string skinName = ((sender as ComboBox).SelectedValue as ComboBoxItem).Content.ToString();

            ResourceDictionary dic = new ResourceDictionary();
            if (skinName != "Default")
            {
                //dic.MergedDictionaries.Add(Application.LoadComponent(new Uri("/lib;component/Skins/Default.xaml", UriKind.Relative)) as ResourceDictionary);
            }
            dic.MergedDictionaries.Add(Application.LoadComponent(new Uri(string.Format("/lib;component/Skins/{0}.xaml", skinName), UriKind.Relative)) as ResourceDictionary);
            Application.Current.Resources = dic;
        }
    }
}
